package MR_process.MR4;

import java.io.IOException;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import MR_process.Bean3;

public class Map4 extends Mapper<LongWritable,Text,Text, Bean3>{
    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        // 获取字段 "id" 和 "combined_text"
        String line = value.toString();
        String[] words = line.split("\t");
        String word = words[0];
        String id = words[1];
        long count = Long.parseLong(words[2]);
        long len=Long.parseLong(words[3]);
        long distinct_id = Long.parseLong(words[4]);
        context.write(new Text(word), new Bean3(word,id,count,len,distinct_id) );
    }
}
